package cn.usts.edu.lesson05;

import javax.swing.*;
import java.awt.*;

public class JScrollDemo extends JFrame {
    public JScrollDemo() {
        this.setTitle("文本域");
        this.setBounds(100,100,500,500);
        this.setVisible(true);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // 文本域
        JTextArea textArea = new JTextArea(20,50);
        textArea.setText("文本域默认输入的内容");

        // JScroll带滚动条的
        JScrollPane scrollPane = new JScrollPane(textArea);

        Container container = this.getContentPane();
        container.add(scrollPane);

    }

    public static void main(String[] args) {
        new JScrollDemo();
    }
}
